<?php


class TacheTable extends Doctrine_Table {

    public static function getInstance() {
        return Doctrine_Core::getTable('Tache');
    }

    public static function getTacheParInterval($start = null, $end = null) {
        $events = array();
        if ($start == null || $end == null) {
            $events = $this->findAll();
        } else {
            $query = new Doctrine_Query();
            $query->from('Tache t');
                  /*->addWhere('t.date > ' , $start)
                  ->orWhere ('t.date = ' , $start)
                  ->andWhere('t.date < ' , $end)
                  ->orWhere ('t.date = ' , $end);*/
            $events = $query->execute();
        }

        return $events;
    }
}